<template>
	<view>
		<view class="bill" v-for=" item in obj2" :key="item.productId" @click="tiaozhuan">
			<!-- 头像 -->
			<view class="bill-img">
				<image src="../../static/discovery/icon11.png" mode=""></image>
			</view>
			<!-- 信息 -->
			<view class="bill-message">
				<view class="">
					<!-- 公司名字 -->
					<text>{{item.couponName}}</text>
				</view>
				<!-- 时间 -->
				<view class="">
					<text>8月2日 09:13</text>
				</view>
			</view>
			<!-- 金额 -->
			<view class="bill-money">
				<text :class="item.modifiedPrice>=0 ? 'active': '' ">{{item.modifiedPrice}}</text>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				//账单信息
				obj: [],
				obj2: []
			}
		},
		methods: {
			// 跳转
			tiaozhuan(){
				uni.navigateTo({
					url:"/pages/billDetails/billDetails?obj=1"
				})
			}

		},
		onLoad(e) {
			this.obj = JSON.parse(e.bill);
			this.obj.forEach(item => {
				if (item.couponName) {
					this.obj2.push(item)
				}
			})
		}
	}
</script>

<style scoped lang="scss">
	@import './bill.scss';

	.active {
		color: #FF7846;
	}
</style>
